package com.verisette.ncos.service.card.gateway;

import java.util.List;

import org.corp.agi.common.util.BeanContextFactory;
import org.corp.agi.service.bean.ServiceRequest;
import org.corp.agi.service.bean.ServiceResponse;
import org.corp.agi.service.bizprocess.BusinessProcess;

import com.verisette.ncos.persistence.domain.MasterTemplate;
import com.verisette.ncos.persistence.domain.TransCustomerOrder;
import com.verisette.ncos.web.card.bean.CardCreateBean;
import com.verisette.ncos.web.card.bean.CardTemplateSearchBean;

/**
 * {Description here}
 *
 * @author Thippawan Muangchu (Tip)
 * @since Apr 8, 2010 1:48:48 PM
 * @version 1.0.0
 * @see 
 */
public class CardServiceImpl implements CardService {

	@Override
	public ServiceResponse<List<MasterTemplate>> inquiryCardTemplate(
			ServiceRequest<CardTemplateSearchBean> request) {
		// TODO Auto-generated method stub
		BusinessProcess process = (BusinessProcess) BeanContextFactory.getBean("inquiryCardTemplateProcess");
		return process.execute(request);
	}
	
	@Override
	public ServiceResponse<CardCreateBean> createCardByTemplate(
			ServiceRequest<CardCreateBean> request) {
		// TODO Auto-generated method stub
		BusinessProcess process = (BusinessProcess) BeanContextFactory.getBean("createCardByTemplateProcess");
		return process.execute(request);
	}

	@Override
	public ServiceResponse<CardCreateBean> createSaleCardByTemplate(
			ServiceRequest<CardCreateBean> request) {
		// TODO Auto-generated method stub
		BusinessProcess process = (BusinessProcess) BeanContextFactory.getBean("createSaleCardByTemplateProcess");
		return process.execute(request);
	}

	@Override
	public ServiceResponse<CardCreateBean> createOfficerCardByTemplate(
			ServiceRequest<CardCreateBean> request) {
		// TODO Auto-generated method stub
		BusinessProcess process = (BusinessProcess) BeanContextFactory.getBean("createOfficerCardByTemplateProcess");
		return process.execute(request);
	}

	@Override
	public ServiceResponse<CardCreateBean> saveCardByTemplate(
			ServiceRequest<CardCreateBean> request) {
		// TODO Auto-generated method stub
		BusinessProcess process = (BusinessProcess) BeanContextFactory.getBean("saveCardByTemplateProcess");
		return process.execute(request);
	}

	@Override
	public ServiceResponse<TransCustomerOrder> inquiryCardOrderById(
			ServiceRequest<Integer> request) {
		// TODO Auto-generated method stub
		BusinessProcess process = (BusinessProcess) BeanContextFactory.getBean("inquiryCardOrderProcess");
		return process.execute(request);
	}
}
